import {auth} from "@/lib/auth";
import {headers} from "next/headers";
import {Button} from "@/components/ui/button"
import {redirect} from "next/navigation";
export default async function Home() {

    const session = await auth.api.getSession({
        headers: await headers() // you need to pass the headers object.
    })

    if (!session) {
        return redirect("/auth/sign-in")
    }

    return (
        <div>
            <Button>{session.user.email}</Button>
        </div>
    )
}